package com.nc.user.controller.admin;

import com.nc.user.model.dto.UserDto;
import com.nc.user.service.AdminUsersService;
import com.plug.result.ReqPage;
import com.plug.result.RetResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


/**
 * 创建人:    xvzhe
 * 创建时间:
 * 修改时间:
 * 版本:      v1.0
 */
@RestController
@RequestMapping("AdminUsersController")
@Api(tags = "管理员接口")
public class AdminUsersController {
    @Autowired
    private AdminUsersService adminUsersService;

    @ApiOperation("保存")
    @PostMapping("user")
    public RetResult addData(@RequestBody UserDto userDto) {
        return adminUsersService.save(userDto);
    }

    @PostMapping("user/all")
    @ApiOperation("获得全部用户")
    public RetResult findAll(@RequestBody ReqPage reqPage) {
        return adminUsersService.findPage(reqPage);
    }
}
